package com.app.teaware.bean;


import com.alibaba.fastjson.annotation.JSONField;

import java.util.ArrayList;

public class ProjectFileListBean extends BaseListBeanXF {

    @JSONField(name = "data")
    private ArrayList<ProjectFileData> list = new ArrayList<ProjectFileData>();

    public ArrayList<ProjectFileData> getList() {
        return list;
    }

    public void setList(ArrayList<ProjectFileData> list) {
        this.list = list;
    }

    public void addListBean(ProjectFileListBean listbean) {
        if (listbean == null)
            return;
        if (this.getCurrent() == INIT_PAGE) {
            setList(listbean.getList());
        } else {
            if (list == null)
                list = new ArrayList<ProjectFileData>();
            list.addAll(listbean.getList());
        }
        setListBeanData(listbean);
    }

    public ArrayList<String> getListPic(){
        ArrayList<String> listStr = new ArrayList<>();
        for(ProjectFileData data:list){
//            if(data.getFileUrl().endsWith(".zip") ||data.getFileUrl().endsWith(".rar") ){
//                listStr.add(ImageUtils.imageTranslateUri(BasisApp.getInstance().getResources(), R.drawable.img_empty_searchresult));
//            }else{
//                listStr.add(data.getFileUrl());
//            }
            listStr.add(data.getFilePath());
        }
        return  listStr;
    }

    public ArrayList<String> getListPicOnlypic(){
        ArrayList<String> listStr = new ArrayList<>();
        for(ProjectFileData data:list){
//            if(data.getFileUrl().endsWith(".zip") ||data.getFileUrl().endsWith(".rar") ){
//                listStr.add(ImageUtils.imageTranslateUri(BasisApp.getInstance().getResources(), R.drawable.img_empty_searchresult));
//            }else{
//                listStr.add(data.getFileUrl());
//            }
            if(data.isFileImg()){
                listStr.add(data.getFilePath());
            }
        }
        return  listStr;
    }
}
